﻿using System;
using System.Text;
using System.Drawing;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;

public static partial class glDRIVE
{
    /*
    函数 gl.sdet
    行列式求值
    参数 a: a[n][n]存放方阵A的元素。返回时被破坏
    参数 n: 
    返回值 返回行列式值。
    */

    public static string drive_sdet()
    {
        double[,] a = new double[4, 4]{
            {1.0,2.0,3.0,4.0},
            {5.0,6.0,7.0,8.0},
            {9.0,10.0,11.0,12.0},
            {13.0,14.0,15.0,16.0}
        };
        double[,] b = new double[4, 4]{
            {3.0,-3.0,-2.0,4.0},
            {5.0,-5.0,1.0,8.0},
            {11.0,8.0,5.0,-7.0},
            {5.0,-1.0,-3.0,-1.0}
        };
        string rs = "";
        rs += gl.html_table("det(A)=" + gl.sdet(a, 4), a);
        rs += gl.html_table("det(B)=" + gl.sdet(b, 4), b);
        return rs;
    }
}
